package com.xjprojectc.uitl;

public class StringUtil {
	//private static StringBuffer sb = new StringBuffer();

	/**
	 * ���ַ������ת��Ϊһ���ַ�
	 * 
	 * @param strs
	 * @return
	 */
	public static String strArray(String[] strs) {
		StringBuffer sb = new StringBuffer();
		if (strs == null) {
			return null;
		}
		for (int i = 0; i <strs.length; i++) {
			sb.append(strs[i]);
			if (i != strs.length - 1) {
				sb.append(',');
			}
		}
		System.out.println("sb.toString()0--------"+sb.toString());
		return sb.toString();
	}

	/**
	 * ���ַ�ת��Ϊһ���ַ������
	 * 
	 * @param str
	 * @return
	 */
	public static String[] strArray(String str) {
		if (str == null || "".equals(str)) {
			return null;
		}
		return str.split(",");
	}
}
